﻿<?php

$connect = mysql_connect('localhost', 'tass', '114'); // DB 연결

$db_id=mysql_select_db("tass",$connect);  // DB 선택

$type = $_REQUEST['type']; 
$user = $_REQUEST['user'];

//$type = 0; 
//$user = 'ssi5320';

if($type==0){
    $sql = "SELECT * FROM login_info WHERE id = '$user';";
}//id
else if($type==1){
    $sql = "SELECT * FROM login_info WHERE name = '$user';";
}//name
else if($type==2){
    $sql = "SELECT * FROM login_info WHERE email = '$user';";
}//email

$rs = mysql_query($sql, $connect);
while($result = mysql_fetch_array($rs)){
  $id = $result[id];
  $name = $result[name];
  $email = $result[email];
      $xmlList.="<user><id>$id</id><name>$name</name><email>$email</email></user>";
}
//$xmlDoc = iconv("", "utf-8", $xmlDoc); 
$xmlDoc="<?xml version='1.0' encoding='utf-8'?><root>$xmlList</root>";
echo  $xmlDoc;



?>